import { Component, OnInit, Output, EventEmitter } from '@angular/core';
import { Router } from '@angular/router';
import { Nav } from 'app/classes/Device';
@Component({
  selector: 'app-header',
  templateUrl: './header.component.html',
  styleUrls: ['./header.component.css']
})
export class HeaderComponent implements OnInit {
  @Output()
  changeChildNav: EventEmitter<Nav> = new EventEmitter();

  public navs: Array<Nav>;
  public status: number;
  public topNavActive = 'topNav01';

  constructor(public router: Router) { }

  ngOnInit() {
    this.navs = [
      new Nav('首页', '/index/default', 'default'),
      new Nav('数据查询', '/index/moniter', 'dataQuery'),
      new Nav('事件管理', '/index/event', 'event'),
      new Nav('统计分析', '/index/count', 'count'),
      new Nav('节能分析', '/index/conserve', 'conserve'),
      new Nav('系统设置', '/index/config', 'config')
    ]
  }
  send(nav: Nav) {
    this.changeChildNav.emit(nav);
  }
}
